<template>
	<div class="container">
		<van-sticky>
			<van-nav-bar
			  title="购物车"
			  left-text="返回"
			  left-arrow
			  @click-left="onClickLeft"
			/>
		</van-sticky>
		<cart-list v-for="item in 2"></cart-list>
		<div class="cart-like" >
			<van-divider :style="{ color: '#F64229',borderColor: '#999', padding: '0 16px' }">
			  <van-icon name="like" />猜你喜欢
			</van-divider>
			
			<div class="like-content">
			<like-list :classifyList ="likeContent"></like-list>
			</div>
			
		</div>
		
		<van-submit-bar :price="3050" button-text="结算" @submit="onSubmit">
		  <van-checkbox v-model="AllVal" color="#68ACF2">全选</van-checkbox>
		</van-submit-bar>
		
	</div>
</template>

<script>
	import cartList from '../components/cart/cart-list.vue'
	import likeList from '../components/cart/like-list.vue'

	export default{
		data(){
			return {
				AllVal : 'true',
				onSubmit : '',
				likeContent : [],
			}
		},
		created() {
			//猜你喜欢数据
			this.axios.get('/api_goods', {
				params : {
					catId : '0069',
					page : 1,
					pagesize : 4,				
				}
			}).then((val) => {
				let {data} = val;
				if(data.code != 0){
					console.log(data);
					return;
				};
				//修改数据
				this.likeContent = data.data;
			})
		},
		methods : {
			onClickLeft(){
				this.$router.go(-1);
			}
		},
		components :{
			cartList,
			likeList
		} 
	}
</script>

<style scoped lang="less">
	.cart-title{
		height: 50px;
		font-size: 16px;
		text-align: center;
		line-height: 50px;
		background-color: #fff;
		color:#000000;
	}
	.like-content{
		padding: 0px 12px;
	}
	.cart-like{
		margin: 20px 0px;
	}
	.submit-bar{
		position: fixed;
		left: 0px;
		bottom: 50px;
	}
</style>
